<?php $__env->startSection('title','Редактирование участника'); ?>
<?php $__env->startSection('content'); ?>
    <div class="mt-10">
        <form action="<?php echo e(route('members.update', $member->id)); ?>" method="POST"
              class="grid grid-cols-1 gap-[30px] max-w-[600px]">
            <?php echo csrf_field(); ?>
            <?php echo method_field('PATCH'); ?>


            <div>
                <label for="fullname">ФИО</label>
                <input id="fullname" name="fullname" type="text"
                       class="w-full shadow-sky-200 shadow p-[20px] rounded-[10px]" placeholder="ФИО"
                       value="<?php echo e($member->fullname); ?>">
                <?php $__errorArgs = ['fullname'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div>
                <label for="birthday">Дата рождения</label>
                <input id="birthday" name="birthday" type="date"
                       class="w-full shadow-sky-200 shadow p-[20px] rounded-[10px]" placeholder="Дата рождения"
                       value="<?php echo e($member->birthday); ?>">
                <?php $__errorArgs = ['birthday'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div>

                <label for="diagnosis">Диагноз</label>
                <select id="diagnosis" name="diagnosis">

                    <?php $__currentLoopData = $sickness; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sicknes): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                        <option <?php if($sicknes->name === $member->diagnosis): echo 'selected'; endif; ?> value="<?php echo e($sicknes->name); ?>">
                            <?php echo e($sicknes->name); ?>

                        </option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                </select>


                <?php $__errorArgs = ['diagnosis'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div>
                <label for="fullname_agent">ФИО представителя</label>
                <input id="fullname_agent" name="fullname_agent" type="text"
                       class="w-full shadow-sky-200 shadow p-[20px] rounded-[10px]" placeholder="ФИО представителя"
                       value="<?php echo e($member->fullname_agent); ?>">
                <?php $__errorArgs = ['fullname_agent'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div>
                <label for="agent_phone">Телефон представителя</label>
                <input id="agent_phone" name="agent_phone" type="text"
                       class="w-full shadow-sky-200 shadow p-[20px] rounded-[10px]" placeholder="Телефон представителя"
                       value="<?php echo e($member->agent_phone); ?>">
                <?php $__errorArgs = ['agent_phone'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div>
                <label for="email">Почта</label>
                <input id="email" name="email" type="text" class="w-full shadow-sky-200 shadow p-[20px] rounded-[10px]"
                       placeholder="Почта" value="<?php echo e($member->email); ?>">
                <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div>
                <input name="user_id" type="hidden" value="<?php echo e($member->user_id); ?>">
                <?php $__errorArgs = ['user_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>


            <div>
                <label for="centers_id">Выберите центр</label>
                <select id="centers_id" name="centers_id">

                    <?php $__currentLoopData = $centers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $center): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                        <option value="<?php echo e($center->id); ?>"
                                <?php if($center->id == $member->centers_id): ?> selected <?php endif; ?>><?php echo e($center->name); ?></option>

                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                </select>
                <?php $__errorArgs = ['centers_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

            </div>

            <div>
                <label for="diseases">Сопутствующие заболевания</label>
                <select id="diseases" name="diseases[]" multiple>
                    <?php $__currentLoopData = $diseases; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $disease): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option <?php if(in_array( $disease->id,$memberDiseasesIds)): echo 'selected'; endif; ?> value="<?php echo e($disease->id); ?>"> <?php echo e($disease->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['diseases'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

            </div>
            <div>
                <label for="rehabilitation">
                    Посещение других реабилитационных программ
                </label>
                <select id="rehabilitation" name="rehabilitation[]" multiple required>
                    <?php $__currentLoopData = $rehabilitations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rehabilitation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option
                            <?php if(in_array( $rehabilitation->id,$memberRehabilitationsIds)): echo 'selected'; endif; ?> value="<?php echo e($rehabilitation->id); ?>"><?php echo e($rehabilitation->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['rehabilitation'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

            </div>

            <div>
                <label for="physical_condition">Общее физическое состояние</label>
                <select id="physical_condition" name="physical_condition">
                    <option <?php if($member->physical_condition === 'прекрасное'): echo 'selected'; endif; ?> value="прекрасное">прекрасное
                    </option>
                    <option <?php if($member->physical_condition === 'хорошее'): echo 'selected'; endif; ?> value="хорошее">хорошее</option>
                    <option <?php if($member->physical_condition === 'удовлетворительное'): echo 'selected'; endif; ?> value="удовлетворительное">
                        удовлетворительное
                    </option>
                    <option
                        <?php if($member->physical_condition === 'неудовлетворительное'): echo 'selected'; endif; ?> value="неудовлетворительное">
                        неудовлетворительное
                    </option>
                    </option>
                </select>
                <?php $__errorArgs = ['physical_condition'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

            </div>



            <div>
                <label for="behavior">
                    Особенности поведения, свойственные ребенку
                </label>
                <select id="behavior" name="behavior[]" multiple>
                    <?php $__currentLoopData = $behaviors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $behavior): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option <?php if(in_array( $behavior->id,$memberBehaviorsIds)): echo 'selected'; endif; ?> value="<?php echo e($behavior->id); ?>"><?php echo e($behavior->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['behavior'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

            </div>
            <div>
                <label for="skills_id">Какими навыками обладает ребенок</label>
                <select id="skills_id" name="skills[]" multiple required>
                    <?php $__currentLoopData = $skills; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $skill): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option
                            <?php if(in_array($skill->id,$memberSkillsIds)): echo 'selected'; endif; ?> value="<?php echo e($skill->id); ?>"><?php echo e($skill->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['skills'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

            </div>
            <div>
                <label for="walking">
                    Характеристика навыков ходьбы
                </label>
                <select id="walking" name="walking[]" multiple>
                    <?php $__currentLoopData = $walkings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $walking): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option <?php if(in_array($walking->id,$memberWalkingsIds)): echo 'selected'; endif; ?> value="<?php echo e($walking->id); ?>"><?php echo e($walking->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['walking'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <div>
                    <?php echo e($message); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

            </div>

            <input type="submit" value="Обновить" class="bg-blue-700 p-4 text-white font-bold">
        </form>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/resources/views/members/edit.blade.php ENDPATH**/ ?>